SimilarWeb Domain Analytics API provides you with website traffic and competitor data. You will receive total website visits, website traffic by countries along with its sources, site ranks, and various competitor data. This data is especially useful for running competitor analysis and market intelligence campaigns. Note that you can get data only for websites with over 5,000 monthly visitors due to SimilarWeb restrictions.
Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-dashboard
# Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard
login="login"
password="password"
cred="$(printf ${login}:${password} | base64)"
curl --location --request POST "https://api.dataforseo.com/v3/domain_analytics/similarweb/live"
--header "Authorization: Basic ${cred}"
--header "Content-Type: application/json"
--data-raw "[
{
"target": "inc.com"
}
]"
<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
try {
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard
$client = new RestClient($api_url, null, 'login', 'password');
} catch (RestClientException $e) {
echo "n";
print "HTTP code: {$e->getHttpCode()}n";
print "Error code: {$e->getCode()}n";
print "Message: {$e->getMessage()}n";
print $e->getTraceAsString();
echo "n";
exit();
}
$post_array = array();
// You can set only one task at a time
$post_array[] = array(
"target" => "inc.com"
);
try {
// POST /v3/domain_analytics/similarweb/live
$result = $client->post('/v3/domain_analytics/similarweb/live', $post_array);
print_r($result);
// do something with post result
} catch (RestClientException $e) {
echo "n";
print "HTTP code: {$e->getHttpCode()}n";
print "Error code: {$e->getCode()}n";
print "Message: {$e->getMessage()}n";
print $e->getTraceAsString();
echo "n";
}
$client = null;
?>
from client import RestClient
# You can download this file from here https://cdn.dataforseo.com/v3/examples/python/python_Client.zip
client = RestClient("login", "password")
post_data = dict()
# You can set only one task at a time
post_data[len(post_data)] = dict(
target="inc.com"
)
# POST /v3/domain_analytics/similarweb/live
response = client.post("/v3/domain_analytics/similarweb/live", post_data)
# you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if response["status_code"] == 20000:
print(response)
# do something with result
else:
print("error. Code: %d Message: %s" % (response["status_code"], response["status_message"]))
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace DataForSeoDemos
{
public static partial class Demos
{
public static async Task domain_analytics_similarweb_live()
{
var httpClient = new HttpClient
{
BaseAddress = new Uri("https://api.dataforseo.com/"),
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-dashboard
DefaultRequestHeaders = { Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes("login:password"))) }
};
var postData = new List<object>();
// You can set only one task at a time
postData.Add(new
{
target = "inc.com"
});
// POST /v3/domain_analytics/similarweb/live
var taskPostResponse = await httpClient.PostAsync("/v3/domain_analytics/similarweb/live", new StringContent(JsonConvert.SerializeObject(postData)));
var result = JsonConvert.DeserializeObject<dynamic>(await taskPostResponse.Content.ReadAsStringAsync());
// you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
if (result.status_code == 20000)
{
// do something with result
Console.WriteLine(result);
}
else
Console.WriteLine($"error. Code: {result.status_code} Message: {result.status_message}");
}
}
}
The above command returns JSON structured like this:
All POST data should be sent in the JSON format (UTF-8 encoding). The task setting is done using the POST method. When setting a task, you should send all task parameters in the task array of the generic POST array. SimilarWeb Domain Analytics API can handle only 30 tasks per minute due to SimilarWeb restrictions. You might receive limit-related errors if over 30 SimilarWeb Domain Analytics API calls were sent to our system within a minute.
Below you will find a detailed description of the fields you can use for setting a task.
Description of the fields for setting a task:
Field name
Type
Description
target
string
website domain required field
you need to specify the domain you want to receive results for
example:
“website.com”
tag
string
user-defined task identifier
optional field the character limit is 255
you can use this parameter to identify the task and match it with the result
you will find the specified tag value in the data array of the response
As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.
Description of the fields in the results array:
Field name
Type
Description
version
string
the current version of the API
status_code
integer
general status code
you can find the full list of the response codes here Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions
status_message
string
general informational message
you can find the full list of general informational messages here
time
string
execution time, seconds
cost
float
total tasks cost, USD
tasks_count
integer
the number of tasks in the tasks array
tasks_error
integer
the number of tasks in the tasks array returned with an error
tasks
array
array of tasks
id
string
task identifier unique task identifier in our system in the UUID format
status_code
integer
status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
status_message
string
informational message of the task
you can find the full list of general informational messages here
time
string
execution time, seconds
cost
float
cost of the task, USD
result_count
integer
number of elements in the result array
path
array
URL path
data
object
contains the same parameters that you specified in the POST request
result
array
array of results
site_url
string
target url
targeted domain URL
company_name
string
name of the company
name of the company the target domain belongs to
site_description
string
description metatag of the main page
global_rank
object
traffic rank of a targeted domain
as compared to other domains in the world
rank
integer
global rank value
country_rank
object
traffic rank of a targeted domain
as compared to other domains in the leading country
rank
integer
country rank value
country
string
the leading country
category_rank
object
traffic rank of a targeted domain as compared to other domains in the main category
rank
integer
category rank value
category
string
the main category
headquarters
object
headquarters of the company
country
string
headquarters country
state
string
headquarters state
city
string
headquarters city
revenue
object
revenue of the company
revenue_min
integer
minimum revenue of the company
revenue_max
integer
maximum revenue of the company
employees
object
number of employees working for the company
employees_min
integer
minimum number of employees
employees_max
integer
maximum number of employees
audience
object
overall traffic and engagement metrics
on desktop and mobile devices
visits
integer
total monthly visits
time_on_site_avg
float
time on site
average session duration
page_views_avg
float
page views
average number of pages viewed during the session
bounce_rate
float
bounce rate
the percentage of visitors who navigated away from the site after viewing only one page
top_categories
array
top categories
categories most visited by the users of the analyzed site
you can get the full list of possible categories with their titles and ids by this link
title
string
category title
category_id
string
category id
other_visited_websites
array
other visited websites
visitors of the analyzed site also visited these websites
top_topics
array
top topics
top tags on the websites visted by the users of the analyzed site
traffic
object
traffic and its sources
for desktop only
value
integer
total traffic volume
percent
float
total traffic volume percentage
countries
array
traffic by countries
country
string
country
value
integer
traffic volume from a country
percent
float
percentage of total traffic
sources
object
traffic sources
for desktop only
direct
object
direct traffic
value
integer
direct traffic volume
percent
float
percentage of direct traffic
search_organic
object
organic search traffic
value
integer
organic search traffic volume
percent
float
percentage of organic search traffic
top_keywords
array
top organic search keywords by traffic volume
keyword
string
organic search keyword
value
integer
organic searcht raffic volume brought by a keyword
percent
float
percentage of organic search traffic brought by a keyword
search_ad
object
paid search traffic
value
integer
paid search traffic volume
percent
float
percentage of paid search traffic
top_keywords
array
top paid search keywords by traffic volume
keyword
string
paid search keyword
value
integer
paid search traffic volume brought by a keyword
percent
float
percentage of paid search traffic brought by a keyword
referring
object
organic referral traffic
value
integer
organic referral traffic volume
percent
float
percentage of organic referral traffic
top_referring
array
top referring sites
site
string
referral site
value
integer
organic referral traffic volume from a site
percent
float
percentage of organic referral traffic volume from a site
referral_destination
object
sites that a targeted domain refers to
top_destinations
array
top sites that a targeted domain refers to
site
string
destination site
social
object
social traffic
value
integer
social traffic volume
percent
float
percentage of social traffic
top_socials
array
top social networks by traffic volume
site
string
social network
value
integer
traffic volume
percent
float
percentage of traffic volume
display_ad
object
traffic gained through display advertising
value
integer
traffic volume from display ads
percent
float
percentage of traffic
top_publishers
array
leading paid referring sites by traffic volume
site
string
publisher referring advertising traffic to the site
top_ad_networks
array
top ad networks by traffic volume
site
string
ad network
value
integer
traffic volume
percent
float
percentage of traffic volume
mobile_apps
object
mobile apps related to the targeted domain
google_play_store
array
related mobile apps in Google Play Store
app_id
string
unique application ID
app_title
string
application title
app_price
string
application price
app_rating
string
application rating
app_link
string
application link in Google Play Store
app_store
array
related mobile apps in Apple Store
app_id
string
unique application ID
app_title
string
application title
app_price
string
application price
app_rating
string
application rating
app_link
string
application link in Apple Store
mail
object
traffic from email campaigns
value
integer
mail traffic value
percent
float
mail traffic percentage
estimated
array
estimated traffic in previous months
date
string
date for which the traffic is estimated
“yyyy-mm-dd” format is used
value
integer
monthly traffic value
sites
object
competitors and similar sites
similar_sites
array
sites similar to the targeted site
sites that share the same audience, or compete for the same keywords, or have сommon links to and from the compared sites, or share similar content
site
string
similar site
rank
integer
global rank of a site
similar_sites_by_rank
array
sites similar to the targeted site
sites that have close global rank values